home *** CD-ROM | disk | FTP | other *** search
/ Cre@te Online 2000 December / Cre@teOnline CD05.iso / MacSoft / XML ConsoleMax.sea / XML ConsoleMax / Required / swingall.jar / javax / swing / plaf / basic / BasicTreeUI$MouseHandler.class (.txt) < prev    next >
Encoding:
Java Class File  |  1999-07-15  |  1.6 KB  |  40 lines

  1. package javax.swing.plaf.basic;
  2.  
  3. import java.awt.Rectangle;
  4. import java.awt.event.MouseAdapter;
  5. import java.awt.event.MouseEvent;
  6. import javax.swing.SwingUtilities;
  7. import javax.swing.tree.TreePath;
  8.  
  9. public class BasicTreeUI$MouseHandler extends MouseAdapter {
  10.    // $FF: synthetic field
  11.    private final BasicTreeUI this$0;
  12.  
  13.    public BasicTreeUI$MouseHandler(BasicTreeUI var1) {
  14.       this.this$0 = var1;
  15.    }
  16.  
  17.    public void mousePressed(MouseEvent var1) {
  18.       if (this.this$0.tree != null && this.this$0.tree.isEnabled()) {
  19.          this.this$0.tree.requestFocus();
  20.          TreePath var2 = this.this$0.getClosestPathForLocation(this.this$0.tree, var1.getX(), var1.getY());
  21.          if (var2 != null) {
  22.             Rectangle var3 = this.this$0.getPathBounds(this.this$0.tree, var2);
  23.             if (var1.getY() > var3.y + var3.height) {
  24.                return;
  25.             }
  26.  
  27.             if (SwingUtilities.isLeftMouseButton(var1)) {
  28.                this.this$0.checkForClickInExpandControl(var2, var1.getX(), var1.getY());
  29.             }
  30.  
  31.             int var4 = var1.getX();
  32.             if (var4 > var3.x && var4 <= var3.x + var3.width && !this.this$0.startEditing(var2, var1)) {
  33.                this.this$0.selectPathForEvent(var2, var1);
  34.             }
  35.          }
  36.       }
  37.  
  38.    }
  39. }
  40.